package com.yuyi.full;

/**
 * @since:
 * @author: wulitong
 * @create: 2020-08-17 17:53
 */
public enum ResultStatus {
  
	SUCCESS(200,"成功"),
	//201-299用户信息
	ERR_USER_IS_NULL(201,"用户不存在"),
	// 信息重复提交
	ERR_SUBMIT_AGEN(202,"我们已经收到您的提交,请稍微等待一下。"),
	//操作
	ERR_SUBMIT_SAVE(203,"数据新增失败"),
	ERR_SUBMIT_UPDATE(204,"数据修改失败"),
	ERR_SUBMIT_DLE(205,"数据删除失败"),
	
	//300-399 参数校验
	ERR_PARAMS_IS_ILLEGALITY(300,"参数不合法"),
	ERR_PHONE_IS_ILLEGALITY(301,"手机号不非法"),
	
	//400-499 文件上传
    FILE_UPLOAD_ERROR(400, "文件上传异常，请稍后重试");
	
	//600



    private final int status;
    private final String responsePhrase;

    private ResultStatus(int status, String responsePhrase) {
        this.status = status;
        this.responsePhrase = responsePhrase;
    }

    public static String getResponsePhrase(int status) {
        ResultStatus[] values = values();
        ResultStatus[] var2 = values;
        int var3 = values.length;

        for(int var4 = 0; var4 < var3; ++var4) {
            ResultStatus resultStatus = var2[var4];
            if (resultStatus.status == status) {
                return resultStatus.responsePhrase;
            }
        }

        return "";
    }

    public int getStatus() {
        return this.status;
    }

    public String getResponsePhrase() {
        return this.responsePhrase;
    }
}
